-- curl -i '127.0.0.1:6699/api/moses_demo'

local _ = require ("moses")

local fecho = ngx.say

_.each({1,2,3},fecho)

-- => 1 1
-- => 2 2
-- => 3 3

_.each({one = 1, two = 2, three = 3},fecho)

-- => one 1
-- => two 2
-- => three 3

local t = {a = 1, b = 2, [0] = 1, [-1] = 6, 3, x = 4, 5}
_.eachi(t,function(i,v)
  fecho(i,v)
end)

-- => -1 6
-- => 0 1
-- => 1 3
-- => 2 5